import { stringify } from 'qs';
import request from '@/utils/request';

export async function page(payload) {
  return request(`/back/auth/admin/pageAdminRoles?${stringify(payload)}`)
}

export async function get(id) {
  return request(`/back/auth/admin/get/${id}`);
}

export async function del(payload) {
  return request(`/back/auth/admin/del/${payload.uid}`, {
    method: 'POST'
  });
}

export async function delBatch(payload) {
  return request(`/back/auth/admin/delBatch`, {
    method: 'POST',
    body: payload
  });
}

export async function add(payload) {
  return request(`/back/auth/admin/saveAdminRole`, {
    method: 'POST',
    body: payload
  });
}

export async function update(payload) {
  return request(`/back/auth/admin/updateAdminRole`, {
    method: 'PUT',
    body: payload
  });
}